#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author  : lei.wang
import uuid
from django.core.management.base import BaseCommand
from apps.actions.models import ActionTab


class Command(BaseCommand):

    help = '初始化默认动作数据信息'

    def handle(self, *args, **options):

        action_tabs = []
        action_description_mapping = {
            1: '比爱心',
            2: '秀腹肌',
            3: '斗鸡眼',
            4: '一字马',
            5: '拜年',
            6: '倒立',
            7: '做鬼脸',
            8: '做性感动作',
        }
        for i in range(1, 9):
            action_tab_obj = ActionTab(
                id=uuid.uuid4().hex,
                description=action_description_mapping[i],
                image_url=f'media/actions/b{i}.jpg',
            )
            action_tabs.append(action_tab_obj)

        ActionTab.objects.bulk_create(action_tabs)
        print('初始化动作列表成功')
